package com.ygqh.baby.utils;

import java.util.Comparator;

import com.ygqh.baby.po.YgOrderDetail;

/**
 * 按金额从大到小排序
 * 
 * @author admin
 *
 */
public class OrderDetailsComparator implements Comparator<Object> {

	@Override
	public int compare(Object o1, Object o2) {
		YgOrderDetail detail1 = (YgOrderDetail) o1;
		YgOrderDetail detail2 = (YgOrderDetail) o2;
		if (detail1.getSalePrice().compareTo(detail2.getSalePrice()) > 0)
			return -1;
		else if (detail1.getSalePrice().compareTo(detail2.getSalePrice()) == 0)
			return 0;
		else
			return 1;
	}

}
